package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.OrderBean;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 订单表（用户模块） Mapper 接口
 * </p>
 *
 * @author lhy
 * @since 2021-10-05
 */
@Mapper
public interface UserOrderMapper extends BaseMapper<OrderBean> {
    /**
     * 修改订单状态
     *
     * @param orderCode 订单编号
     * @param status    新的订单状态
     */
    public void updateOrderStatus(String orderCode, int status);

    /**
     * 按选项查询一年之内的订单
     *
     * @param status   订单状态
     * @param userCode 用户编号
     * @return 订单集合
     */
    public List<OrderBean> findOrderByItem(Integer status, String userCode);

    public List<OrderBean> findOrderByItemUnFinish(Integer status, String userCode);

    public OrderBean findByOrderCode(String orderCode);

    public void addOrderRiderAndUpdateStatus(String orderCode,String riderCode,String riderName,int status);

    public void finishOrderAndUpdateStatus(String orderCode,int status,String receiveTime);

    public void updateOrderStarStatus(String orderCode);

}
